<template>
  <div style="height: 100%">
    <el-container direction="vertical" style="height: 100%">
      <Header></Header>
      <el-container class="middle">
        <el-aside width="200px">
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import api from '@/axios.js'
import Header from '../layout/header'
import News from './news'
export default {
  components: {Header, News},
  methods: {
    logout() {
            //清除token
            this.$store.dispatch('UserLogout');
            if (!this.$store.state.token) {
                this.$router.push('/login')
                this.$message({
                    type: 'success',
                    message: '登出成功'
                })
            } else {
                this.$message({
                    type: 'info',
                    message: '登出失败'
                })
            }
        }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

/*a {
  color: #42b983;
}*/

.el-aside {
  background-color: #283443;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

a {
    color: #2d7200;
    text-decoration: none;
}
</style>
